package ua.org.nuos.sdms.clientgui.client.view;

import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import ua.org.nuos.sdms.clientgui.client.components.factory.ButtonFactory;
import ua.org.nuos.sdms.clientgui.client.controller.GlobalBoard;
import ua.org.nuos.sdms.clientgui.client.events.ShowLoginFormEvent;
import ua.org.nuos.sdms.clientgui.client.events.ShowRegisterNewUserWindowEvent;

/**
 * Created by IntelliJ IDEA.
 * User: dio
 * Date: 18.03.12
 * Time: 14:11
 * To change this template use File | Settings | File Templates.
 */
public class HelloLayout extends VerticalLayout {

    public HelloLayout() {
        init();
    }

    private void init() {
        Button login = ButtonFactory.getButton("Login", GlobalBoard.ID, ShowLoginFormEvent.class);
        ButtonFactory.setButtonColorStyle(login, ButtonFactory.Color.GREEN);
        Button registration = ButtonFactory.getButton("Registration", GlobalBoard.ID, ShowRegisterNewUserWindowEvent.class);
        ButtonFactory.setButtonColorStyle(registration, ButtonFactory.Color.BLUE);

        setSpacing(true);
        addComponent(new Label("<b>Hello from SDMS project :)</b><br />Login or register:", Label.CONTENT_XHTML));
        addComponent(login);
        addComponent(registration);
    }
}
